﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MLSharp.RProject
{
	/// <summary>
	/// The options to use when building R neural networks.
	/// </summary>
	public class RNeuralNetOptions
	{
		#region Public Properties

		/// <summary>
		/// An array containing the number of neurons in each hidden layer.  The number of entries
		/// in this array determines the number of hidden layers.
		/// </summary>
		/// <value>
		/// The default is 1 hidden layer with twice as many neurons as input variables.
		/// </value>
		public int[] NeuronCounts { get; set; }

		/// <summary>
		/// The learning rate.
		/// </summary>
		/// <value>
		/// The default is 0.2.
		/// </value>
		public double LearningRate { get; set; }

		/// <summary>
		/// The maximum number of training iterations.
		/// </summary>
		/// <value>
		/// The default is 200.
		/// </value>
		public int MaxIterations { get; set; }

		/// <summary>
		/// Indicates whether back-propogation is run in sequential (the default)
		/// or batch mode.
		/// </summary>
		/// <value>
		/// The default is true.
		/// </value>
		public bool Online { get; set; }

		/// <summary>
		/// Flag to control whether the input is randomly permutated between each 
		/// training epoch.
		/// </summary>
		/// <value>
		/// The default is true.
		/// </value>
		public bool Permutate { get; set; }

		/// <summary>
		/// The activation function.
		/// </summary>
		/// <value>The default is <see cref="RActivationFunction.HyperbolicTan"/></value>
		public RActivationFunction ActivationFunction { get; set; }

		/// <summary>
		/// The maximum difference between the desired response and the actual network response 
		/// that is considered acceptable.
		/// </summary>
		/// <value>The default is 0.</value>
		public double MaxError { get; set; }

		#endregion

		#region Public Constructors

		/// <summary>
		/// Initializes all members to their defaults.
		/// </summary>
		public RNeuralNetOptions()
		{
			NeuronCounts = new int[0];
			LearningRate = 0.2;
			MaxIterations = 50;
			Online = true;
			Permutate = true;
			ActivationFunction = RActivationFunction.HyperbolicTan;
			MaxError = 0;
		}

		#endregion
	}
}
